package org.chickymate.server;

import java.util.List;

import org.chickymate.client.CommentService;
import org.chickymate.client.model.CommentDTO;
import org.chickymate.client.model.HostDTO;
import org.chickymate.client.model.ImageDTO;
import org.chickymate.client.model.UrlDTO;
import org.chickymate.server.controller.command.dto.GetPopularCommentsCommand;
import org.chickymate.server.controller.command.dto.GetPopularImagesCommand;
import org.chickymate.server.controller.command.dto.GetPopularUrlsCommand;
import org.chickymate.server.controller.command.dto.GetRecentCommentsCommand;
import org.chickymate.server.controller.command.dto.GetPopularHostsCommand;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;


public class CommentServiceImpl extends RemoteServiceServlet implements CommentService {

	private static final long serialVersionUID = 1L;

	@Override
	public List<CommentDTO> getRecentComments() {
		return new GetRecentCommentsCommand().execute();
	}

	@Override
	public List<HostDTO> getPopularHosts() {
		return new GetPopularHostsCommand().execute();
	}

	@Override
	public List<CommentDTO> getPopularComments() {
		return new GetPopularCommentsCommand().execute();
	}

	@Override
	public List<UrlDTO> getPopularUrls() {
		return new GetPopularUrlsCommand().execute();
	}

	@Override
	public List<ImageDTO> getPopularImages() {
		return new GetPopularImagesCommand().execute();
	}

}
